
#!/usr/bin/python3
# -*- coding: utf-8 -*-
'''
# @file   : Cartesian.py
# @author : weichy
# @date   : 2018/12/22
# @version: 3.0
# @desc   :  程序一直运行，知道用户选择退出。
            (1)让程序结构化
            (2)lambda函数
            新增增加边长的功能
            新增迭代设置
'''
# from turtle import *
from turtle import * 

def draw_pentagram(size):
    turtle = Turtle()
    count =1
    while count<=5:
        turtle.forward(size)
        turtle.right(144)
        count = count + 1 

def draw_recursive_pentagram(size):
    '''
    迭代绘制五角星
    ''' 
    turtle = Turtle()   
    count = 1
    while count <= 5:
     
        turtle.forward(size)
        turtle.right(144)
        count += 1
    size += 10
    if size <= 100:
       draw_recursive_pentagram(size)

def main():
    turtle = Turtle()
    turtle.up()
    turtle.backward(200)
    turtle.down()
    turtle.speed(5)
    turtle.pensize(5)
    turtle.color("black","yellow")
    turtle.begin_fill()

    size =50    
    draw_recursive_pentagram(size)
    # while size <=100:
    #     # draw_pentagram(size)

    #     size += 20
    # turtle.end_fill()
    # turtle.begin_fill()
    # for i in range(5):
    #     turtle.forward(200)
    #     turtle.right(144)
    done()

if __name__ =='__main__':
    main()